Controllers and computer programs use operating systems (OS) or specific derivatives of operating systems in order to react to requests for system configurations relating to hardware and software resources. Many applications especially in embedded computing need to respond precisely, in a well predefined manner and deterministically to requests from hardware and software. These requests may be sent from a communication interface, analogue components or simple a timer which triggers the software to proceed. Operating systems that require such deterministic features are usually real-time operating systems (RTOS).
The OS or RTOS handles all received requests, controls memory allocation and de-allocation, initiates the software to start the handler for that request and organizes the return information etc. The OS or RTOS is flexible and can be adapted to various embedded controller or processing unit architectures. This flexibility through the software of an OS consumes a price in important system resources. The OS or RTOS takes time, clock cycles and memory and thus uses resources beyond the real task to be performed. Therefore, the typical OS consumes power and execution time in order to organize reliable software execution.
Generally a request is triggered by an interrupt and controlled by passing the request to the OS, which acts as a supervisor. The OS sets up the needed resources for the requested task, transfers the execution to the handler of the request, returns response data back to the OS, rewinds the resource allocation (if necessary) and returns to the previous task or other task when complete. The OS maintains a list of all pending and active tasks and their resource allocation.